<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        .txt
        {
            width: 500px;
            height: 20px;
            font-size: 20px;
            line-height: 20px;
            text-align: center;
            display: inline-block;
        }
        #result
        {
            width: 500px;
            height: 24px;
            border: 2px solid black;
            font-size: 20px;
            text-align: center;
        }
        #result2
        {
            width: 500px;
            height: 24px;
            border: 2px solid black;
            font-size: 20px;
            text-align: center;
        }
        #result3
        {
            width: 500px;
            height: 24px;
            border: 2px solid black;
            font-size: 20px;
            text-align: center;
        }
        #result4
        {
            width: 500px;
            height: 24px;
            border: 2px solid black;
            font-size: 20px;
            text-align: center;
        }
        #result5
        {
            width: 500px;
            height: 24px;
            border: 2px solid black;
            font-size: 20px;
            text-align: center;
        }

    </style>
</head>

<body>
    <input class="txt" type="text" placeholder="入职薪水10K，每年涨幅5%，第50年工资为">
    <input type="button" id="btn" value="工资算法">
    <div id="result"></div>
   
    <br>
    <br>
    <br>

    <div class="txt">100以内7的倍数为</div>
    <input type="button" id="btn2"  value="结果是">
    <div id="result2"></div>

    <br>
    <br>
    <br>

    <div class="txt">1/1-1/2+1/3-1/4…..1/100的和</div>
    <input type="button" id="btn3"  value="结果是">
    <div id="result3"></div>



    <br>
    <br>
    <br>

    <div class="txt">100–200之间所有能被3或者7整除的数</div>
    <input type="button" id="btn4"  value="结果是">
    <div id="result4"></div>
    


    <br>
    <br>
    <br>

    <div class="txt">棋盘放芝麻</div>
    <input type="button" id="btn5"  value="结果是">
    <div id="result5"></div>


</body>
<script>
    var btn = document.getElementById("btn")
    var btn2 = document.getElementById("btn2")
    var btn3 = document.getElementById("btn3")
    var btn4 = document.getElementById("btn4")
    var btn5 = document.getElementById("btn5")


    var result = document.getElementById("result")
    var result2 = document.getElementById("result2")
    var result3 = document.getElementById("result3")
    var result4 = document.getElementById("result4")
    var result5 = document.getElementById("result5")
    
    
    btn.onclick = function () 
    {
        var payment = 10;
        var year = 0;
        var all = 0;
        for (year = 0; year < 50; year++) 
        {
             payment *= 1.05
            
        }
        result.innerHTML = payment
       
    }



    btn2.onclick = function ()
    {
        var num2;
        var end2 = ""
        for(num2 = 1; num2 < 100 ; num2 ++)
        {  
            if(!(num2 % 7))
            {     
                end2 += num2 + "-"
                console.log(num2) 
            } 
        } 
        result2.innerHTML = end2;
    }

    btn3.onclick = function ()
    {
        var sum3=0 ;
        var i3 ;
        var y3=-1;

        for( i3 = 1 ; i3 < 101 ; i3++ )
        {
            if( !(i3 % 2))
            {
                sum3 -= 1/i3
            } 
            else
            {
                sum3 += 1/i3
            }
        }
        result3.innerHTML = sum3;    
    }

    btn4.onclick = function ()
    {
        var num4;
        var resu4 = "";
        for(num4 = 100 ; num4 < 201 ; num4 ++)
        {
            if( !(num4 % 3) && !(num4 % 7) )
            {
                resu4 += num4 + "-"
            }
        }
       result4.innerHTML = resu4;
    }


    btn5.onclick = function ()
    {
        var y = 1 ;
        var sum5 = 0;
        for (var x=1 ; x < 65 ; x++)
        {
            y *= 2
            sum5 += y; 
        }
        console.log((sum5 + 1) * 0.00001)
        result5.innerHTML = ((sum5 + 1) * 0.00001)
    }




</script>

</html>